import React from 'react';
import { View, Text, TouchableOpacity, StyleSheet, Alert } from 'react-native';
import { useTranslation } from '../utils/useTranslation';

export function ExampleTranslatedComponent() {
  const { t } = useTranslation();

  const handlePress = () => {
    Alert.alert(
      t('common.success'),
      t('common.info'),
      [
        { text: t('common.cancel'), style: 'cancel' },
        { text: t('common.confirm'), onPress: () => console.log('Confirmed') }
      ]
    );
  };

  return (
    <View style={styles.container}>
      <Text style={styles.title}>{t('navigation.home')}</Text>
      <Text style={styles.description}>
        {t('camera.use')} - {t('camera.cancel')} - {t('camera.retake')}
      </Text>
      
      <TouchableOpacity style={styles.button} onPress={handlePress}>
        <Text style={styles.buttonText}>{t('common.confirm')}</Text>
      </TouchableOpacity>
    </View>
  );
}

const styles = StyleSheet.create({
  container: {
    padding: 20,
    alignItems: 'center',
  },
  title: {
    fontSize: 24,
    fontWeight: 'bold',
    marginBottom: 16,
    color: '#333',
  },
  description: {
    fontSize: 16,
    textAlign: 'center',
    marginBottom: 20,
    color: '#666',
  },
  button: {
    backgroundColor: '#007AFF',
    paddingHorizontal: 24,
    paddingVertical: 12,
    borderRadius: 8,
  },
  buttonText: {
    color: '#fff',
    fontSize: 16,
    fontWeight: '600',
  },
});